// LightIntensityMapper.java
package com.example.smartgreenhouse.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.smartgreenhouse.entity.LightIntensity;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LightIntensityMapper extends BaseMapper<LightIntensity> {

    @Select("SELECT Id, sensor_Id, greenhouse_Id, intensity, intensity_change_value, "
            + "intensity_change_rate, collect_time, create_time FROM light_intensity")
    @Results({
            @Result(column = "Id", property = "id"),
            @Result(column = "sensor_Id", property = "sensorId"),
            @Result(column = "greenhouse_Id", property = "greenhouseId"),
            @Result(column = "intensity_change_value", property = "intensityChangeValue"),
            @Result(column = "intensity_change_rate", property = "intensityChangeRate")
    })
    List<LightIntensity> selectAllWithCustomMapping();
}